#ifndef UTILITY_H_
#define UTILITY_H_
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <netdb.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
char* ip_search(void);
char* get_remote_ip(int socket_connect);
void change_ip_address(char* ip);
int create_socket();
void create_remote_address(int port, char* ip, struct sockaddr_in* result);
int create_connect(char* ip, int port);
int open_bind(int port);

void send_cmd(int fd, char* cmd);
void recv_cmd(int fd, char* buffer, int length);


int get_pasv_port(char* str);
void create_port_comment(char* port_cmd);

void trim(char *string);
char* substr(char* const str, int const position, int const length);
void substring(char str[], char start[100], char end[100], char* result);

int file_put_contents(char* path, char* string);

int contains(char* string, char* substring);
void recv_result(int fd, char* key, char* result);
#endif /* UTILITY_H_ */
